fix(harness): auto-assign new bot PRs to the repo owner (closes #33) - #34
Merged
Merged
Conversation
Detects -a as well as --assignee/--assignee=* so callers passing a short-form assignee aren't overridden. Guards the exec against an unbound-variable error on bash < 4.4 when no args remain. Resolves the owner from the --repo/-R target (when given) ahead of the local origin remote, so cross-repo `pr create --repo other/acct` assigns the other repo's owner instead of the local repo's. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BLTWAXsWFRtN6c1u8aKnP2
robercano
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Bot-authored PRs created via
.claude/scripts/bot-gh.sh pr createarrived with no assignee, so the repo owner got no GitHub notification that a PR was waiting for review — the autonomous loop then stalled on "no-owner-review" until the owner happened to look. This folds in a fix already applied downstream inrobercano/reDeploy.Change
.claude/scripts/bot-gh.shnow auto-assigns every newly created PR to the repo owner:pr createsubcommand, and only when the caller didn't already pass an assignee (handles--assignee,--assignee=, and the short-aform).$OWNER_LOGINenv override → the--repo/-Rtarget owner (so cross-repopr createassigns the right account) → the localoriginremote (offline,git@/httpsforms) →gh repo viewas a last resort.--repocollaborator preflight,set -euo pipefail, and the bot-tokenexec. The empty-arg edge case is guarded (${args[@]+"${args[@]}"}) so it stays safe on bash 3.2+.docs/USAGE.mddocuments the behavior and theOWNER_LOGINoverride in "The PR feedback loop" step 3.Validation
bash -nclean. Reviewed adversarially across four lenses (correctness, tests, security, performance) — all approve. Owner-parse and subcommand-detection exercised via a dry-run matrix (pr createauto-assigns;-a/--assignee/--assignee=respected;--repo/-Rowner precedence;OWNER_LOGINoverride; other subcommands and zero-arg invocations pass through untouched).Known low-severity limitations (outside the documented
owner/repopath, non-blocking): gh's non-OWNER/REPO--repoforms (HOST/OWNER/REPO, full URLs) and attached short-flag syntax (-Rvalue,-avalue) are not specially parsed.Closes #33
🤖 Generated with Claude Code
https://claude.ai/code/session_01BLTWAXsWFRtN6c1u8aKnP2